<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>码段</title>
    <!-- CSS -->
    <jsp:include page="../include/headtag.jsp" />
    <!-- <link rel="stylesheet"
        href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500"> -->
    <link rel="stylesheet"
          href="assets/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="assets/css/form-elements.css">
    <link rel="stylesheet" href="assets/css/style.css">
    <%
        /********** 保存网站的基本路径 ***********/
        String path = request.getContextPath();
        String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
                + path + "/";
        //将该路径地址缓存到 session中 ,例如：http://localhost:8090/tjnu_ssh_1128/
        session.setAttribute("mybasePath", basePath);
    %>
</head>
<body>
<jsp:include page="../include/head.jsp" />
<jsp:include page="../include/menu.jsp" />
<div id="page-wrapper" style="margin-top: 50px;">
    <div id="page-inner">

        <div class="row">
            <div class="col-md-12">
                <h3 class="text-left">编码审核信息汇总</h3>
            </div>
        </div>
        <hr />
        <br />
        <div class="container-fluid">

            <div class="col-md-12">
                <h4 class="text-left">整体审核信息</h4>
            </div>

            <div class="row">
                <div >
                    <div class="form-horizontal">
                        <div class="col-lg-2">
                            <label for="name">审核事物:</label>
                        </div>

                        <div class="col-lg-1">
                            <input type="text" id="name" value="${rule.codeRuleName}" readonly>
                        </div>
                    </div>
                </div>
            </div>

            <br><br>

            <div class="row">
                <div >
                    <div class="form-horizontal">
                        <div class="col-lg-2">
                            <label for="applyreson">申请理由:</label>
                        </div>

                        <div class="col-lg-1">
                            <input type="text" id="applyreson" value="${record.manageContent}" readonly>
                        </div>
                    </div>
                </div>
            </div>
            <br><br>

            <div class="row">
                <div >
                    <div class="form-horizontal">
                        <div class="col-lg-2">
                            <label for="applyreson">申请理由审核结果:</label>
                        </div>

                        <div class="col-lg-1">
                            <input type="text" class="result" value="${topInfo.reasonPass}" readonly>
                        </div>
                    </div>
                </div>
            </div>
            <br><br>

            <div class="row">
                <div >
                    <div class="form-horizontal">
                        <div class="col-lg-2">
                            <label for="unique">唯一性审核结果:</label>
                        </div>

                        <div class="col-lg-1">
                            <input type="text" id="unique" class="result" value="${topInfo.uniqueCheck}" readonly>
                        </div>
                    </div>
                </div>
            </div>
            <br><br><br>

            <div class="row">
                <div >
                    <div class="form-horizontal">
                        <div class="col-lg-2">
                            <label for="format">基本格式审核结果:</label>
                        </div>

                        <div class="col-lg-1">
                            <input type="text" id="format" class="result" value="${topInfo.formatCheck}" readonly>
                        </div>
                    </div>
                </div>
            </div>
            <br><br><br>

            <div class="row">
                <div >
                    <div class="form-horizontal">
                        <div class="col-lg-2">
                            <label for="top_pass">是否通过整体审核:</label>
                        </div>

                        <div class="col-lg-1">
                            <input type="text" id="top_pass" class="result" value="${topInfo.isPass}" readonly="readonly">
                        </div>
                    </div>
                </div>
            </div>
            <br><br><br>

            <div class="col-md-12">
                <h4 class="text-left">非枚举类审核信息</h4>
            </div>


            <c:forEach var="midInfo" items="${midInfos}" varStatus="s">

                <div class="row">
                    <div >
                        <div class="form-horizontal">
                            <div class="col-lg-2">
                                <label >码段名称:</label>
                            </div>

                            <div class="col-lg-1">
                                <input type="text" name="seg_name" value="${midInfo.segName}" readonly>
                            </div>
                        </div>
                    </div>
                </div>

                <br>
                <br>

                <div class="row">
                    <div >
                        <div class="form-horizontal">
                            <div class="col-lg-2">
                                <label >稳定性审核意见:</label>
                            </div>

                            <div class="col-lg-8">
                                <textarea name="wendingx"  class="form-control" style="resize: none;
                                      LINE-HEIGHT:18px;padding: 3px;width:100%;height:100px;max-width:100%;max-height: 100px;" readonly>${midInfo.wending}</textarea>
                            </div>
                        </div>
                    </div>
                </div>

                <br>
                <br>

                <div class="row">
                    <div >
                        <div class="form-horizontal">
                            <div class="col-lg-2">
                                <label >冗余性审核意见:</label>
                            </div>

                            <div class="col-lg-8">
                                <textarea name="wendingx" class="form-control" style="resize: none;
                                      LINE-HEIGHT:18px;padding: 3px;width:100%;height:100px;max-width:100%;max-height: 100px;" readonly>${midInfo.rongyu}</textarea>
                            </div>
                        </div>
                    </div>
                </div>

                <br>
                <br>


                <div class="row">
                    <div >
                        <div class="form-horizontal">
                            <div class="col-lg-2">
                                <label >是否通过码段审核:</label>
                            </div>

                            <div class="col-lg-1">
                                <input type="text" name="seg_name" class="result" value="${midInfo.isPass}" readonly>
                            </div>
                        </div>
                    </div>
                </div>

                <br>
                <br>
                <hr style="border-top:1px dashed #0066CC;"/>
                <br>
                <br>
            </c:forEach>


            <div class="col-md-12">
                <h4 class="text-left">枚举类审核信息</h4>
            </div>


            <c:forEach var="botInfo" items="${botInfos}" varStatus="s">

                <div class="row">
                    <div >
                        <div class="form-horizontal">
                            <div class="col-lg-2">
                                <label >码段名称:</label>
                            </div>

                            <div class="col-lg-1">
                                <input type="text" name="seg_name" value="${botInfo.segName}" readonly>
                            </div>
                        </div>
                    </div>
                </div>

                <br>
                <br>

                <div class="row">
                    <div >
                        <div class="form-horizontal">
                            <div class="col-lg-2">
                                <label >码段审核意见:</label>
                            </div>

                            <div class="col-lg-8">
                                <textarea name="wendingx"  class="form-control" style="resize: none;
                                      LINE-HEIGHT:18px;padding: 3px;width:100%;height:100px;max-width:100%;max-height: 100px;" readonly>${botInfo.botAdvise}</textarea>
                            </div>
                        </div>
                    </div>
                </div>

                <br>
                <br>

                <div class="row">
                    <div >
                        <div class="form-horizontal">
                            <div class="col-lg-2">
                                <label >是否通过码段审核:</label>
                            </div>

                            <div class="col-lg-1">
                                <input type="text" name="seg_name" class="result" value="${botInfo.isPass}" readonly>
                            </div>
                        </div>
                    </div>
                </div>

                <br>
                <br>
                <hr style="border-top:1px dashed #0066CC;"/>
                <br>
                <br>
            </c:forEach>

            <div class="row">
                <div >
                    <div class="form-horizontal">
                        <div class="col-lg-2">
                            <label >最终审核结果:</label>
                        </div>

                        <div class="col-lg-1">
                            <input type="text" name="seg_name" class="result" value="${Pass}" readonly>
                        </div>
                    </div>
                </div>
            </div>
            <br><br><br>

            <div class="row">
                <div >
                    <div class="form-horizontal">
                        <div class="col-lg-2">
                            <label>审核意见:</label>
                        </div>

                        <div class="col-lg-10">
                                <textarea id="opinion" class="form-control"
                                          style="resize: none;
                                      LINE-HEIGHT:18px;padding: 3px;width:100%;height:100px;max-width:100%;max-height: 100px;"></textarea>
                        </div>
                    </div>
                </div>
            </div>


            <br>
            <br>

            <div class="row">
                <button id="next" value="next" class="col-lg-6" onclick="sub_result();">确定</button>
            </div>

        </div>



    </div>
    <!-- /. PAGE INNER  -->
</div>
<!-- /. PAGE WRAPPER  -->

</body>
<!-- Javascript -->
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/bootstrap/js/jquery.min.js"></script>
<script src="assets/js/jquery.backstretch.min.js"></script>


<script type="text/javascript">

    sub_result = function (){


        var url = "/auditing";
        var params = {
            "codeRuleId":${record.newCodeRuleId},
            "recordId":${record.codeRuleManageId},
            "pass":${Pass},
            "advise":$("#opinion").val(),
        };
        $.ajax({
            url:url,
            data:JSON.stringify(params),
            type:"post",
            success:function (resultData) {
                window.location.href="/auditing";
            },
            error:function (data, status, e){
                alert("审核完成!");
                window.location.href="/auditing";
            },
            dataType:"json",
            contentType: 'application/json',
        });
    }
</script>

<script type="text/javascript">

    $(document).ready(function (){
        $(".result").each(function(){
            // alert($(this).val());
            if($(this).val()=="1"){
                $(this).val("通过");
                $(this).css("background-color","#99FF99");
                $(this).attr("aria-describedby","inputSuccess2Status");
            }
            else{
                $(this).val("不通过");
                $(this).css("background-color","#FFA488");
                $(this).attr("aria-describedby","inputError2Status");
            }
        });
    })
</script>



</html>
